home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / ShowClasspath.java < prev    next >
Text File  |  1998-09-27  |  2KB  |  81 lines

  1. package com.symantec.itools.tools.utilities;
  2.  
  3.  
  4. import java.applet.Applet;
  5. import java.io.File;
  6. import java.util.Enumeration;
  7. import java.util.Vector;
  8. import com.symantec.itools.io.FileSystem;
  9. import com.symantec.itools.lang.Classpath;
  10.  
  11.  
  12. /**
  13.  * @author Symantec Internet Tools Division
  14.  * @version 1.0
  15.  * @since VCafe 3.0
  16.  */
  17.  
  18. public class ShowClasspath
  19.     extends Applet
  20. {
  21.     public ShowClasspath()
  22.     {
  23.     }
  24.     
  25.     public void init()
  26.     {
  27.         try
  28.         {
  29.             String[] classpath;
  30.             Vector   valid;
  31.             Vector   invalid;
  32.  
  33.             classpath = new Classpath().getActualClasspath();
  34.             valid     = new Vector();
  35.             invalid   = new Vector();
  36.  
  37.             for(int i = 0; i < classpath.length; i++)
  38.             {
  39.                 File file;
  40.  
  41.                 file = new File(classpath[i]);
  42.  
  43.                 if(file.exists())
  44.                 {
  45.                     valid.addElement(file);
  46.                 }
  47.                 else
  48.                 {
  49.                     invalid.addElement(file);
  50.                 }
  51.             }
  52.  
  53.             System.out.println("Valid CLASSPATH entries (with duplicates):\n");
  54.  
  55.             for(Enumeration e = valid.elements(); e.hasMoreElements();)
  56.             {
  57.                 System.out.println("    " + e.nextElement());
  58.             }
  59.  
  60.             System.out.println("\n\nInvalid CLASSPATH entries:\n");
  61.  
  62.             for(Enumeration e = invalid.elements(); e.hasMoreElements();)
  63.             {
  64.                 System.out.println("    " + e.nextElement());
  65.             }
  66.         }
  67.         catch(SecurityException ex)
  68.         {
  69.             System.out.println("Security Excpetion");
  70.         }            
  71.     }
  72.     
  73.     /**
  74.      * @param argv TODO
  75.      * @since VCafe 3.0
  76.      */     
  77.     public static void main(String[] argv)
  78.     {
  79.         new ShowClasspath().init();
  80.     }
  81. }